/*
 * 用户管理
 * 2017-11-3
 */
$(function(){
	  //初始化第一页数据；  
        var urlApi = 'https://jindi163.com:8443/JDLot/admin/user/list';
		
		var urlApi_find="https://jindi163.com:8443/JDLot/admin/user/query";
			isshows()

		//点击手机号查询执行一次isshows函数
		
			
	function isshows(){//用户信息展示-----用户管理可修改密码--------可删除用户
		phone = sessionStorage.getItem("phone");
		console.log(phone)
        $.ajax({  
            url:urlApi,  
            type:'post',  
            dataType:'json',
            contentType:"application/json",
            async:true,
            cache:false,
            data: {
//          	"phone":phone,
				"PageNum":1,
				"PageSize":20
            },//参数配置：
            xhrFields: {
   						 withCredentials: true
						},
					crossDomain: true,
            success:function(msg){  
            //total总条数属性，计算总页数
            	console.log(msg);
				var  total= msg.totalPage;//显示页数
              	var  result  = msg.datas;   
				$('.usersList').empty()
                var str='<li class="masg_lis" style="color:red"><span>用户账号</span><span>用户密码</span><span>注册时间</span><span>管理员操作</span></li>';  
                for(var i=0;i<result.length;i++){  
		                    var item = result[i];
                    		str +=	'<li class="masg_lis"><span class="use_id_'+i+'">'+item.uphono+
		                    		'</span><span>'+item.upwd+
		                    		'<p style="color:#fff;position:relative;top:-9999px;" class="uid_'+i+'">'+item.uid+'</p></span><span>'+item.uregtime+
		                    		'</span><span><input type="button" class="cost cost_ite"  value="消费记录"><input type="button" class="adds changes_'+i+'" value="修改"><input class="deleted deleted_'+i+'" type="button" value="删除">'+
		                    		'</span></li>';  
                }  
                //追加渲染到页面  
                $('.usersList').append(str)  
                

                $(".PageCode").createPage({  
                    //pageCount：总页数  
                    pageCount:total,  
                    //current：当前页  默认第一页
                    current:1,  
                    backFn:function(pageIndex){  
                    //单击回调方法，pageIndex是当前页码  
                        $(".usersList").empty();  
                        var start =pageIndex;//开始的页码数
						phone = sessionStorage.getItem("phone");
 
                       			$.ajax({  
			                            url:urlApi,  
			                            type:'post',  
			                            dataType:'json', 
			                            contentType:"application/json",
							            async:true,
							            cache:false,
			                           data: {
										"PageSize":10,
										"PageNum":start
										},
										xhrFields: {
   						 withCredentials: true
						},
					crossDomain: true,
			                            success:function(data){  
				                                var result  = data.datas;
				                                console.log(result);
				                               $('.usersList').empty();
                var str='<li class="masg_lis" style="color:red"><span>用户账号</span><span>用户密码</span><span>注册时间</span><span>管理员操作</span></li>';  
                for(var i=0;i<result.length;i++){  
		                    var item = result[i];
                    		str +=	'<li class="masg_lis"><span class="use_id_'+i+'">'+item.uphono+
		                    		'</span><span>'+item.upwd+
		                    		'<p	style="color:#fff;position:relative;top:-9999px;" class="uid_'+i+'">'+item.uid+'</p></span><span>'+item.uregtime+
		                    		'</span><span><input type="button" class="cost cost_ite"  value="消费记录"><input type="button" class="adds changes_'+i+'" value="修改"><input class="deleted deleted_'+i+'" type="button" value="删除"></span></li>';  
                }  
                //追加渲染到页面  
                $('.usersList').append(str);
               	delect();
               	adds();
               	find_xiaofei()
			                            } 
			                        }) 
			                  
                    			}  
                			}); 
                			
                		delect()
                	function delect(){//删除用户
                $(".deleted").each(function(i){//管理员删除用户
                	$(this).click(function(){
                		var index=i;
                		var  usephone=$(".uid_"+index).text();//获取删除的用户的id
                		
                		 
						$("body").append('<div class="ischanges_mima"><div class="mima"><input type="button" value="确认删除" class="isdelet"/><input type="button" value="返回" class="returns"/></div></div>');
						$(".isdelet").click(function(){
							usephone=usephone;
							phone = sessionStorage.getItem("phone");
							console.log(usephone+"---"+phone)
							$.ajax({
							type:"post",
							url:"https://jindi163.com:8443/JDLot/admin/user/del",
							data:{
							"uid":usephone,
//							"phone":phone
							},
							xhrFields: {
   						 withCredentials: true
						},
					crossDomain: true,
							async:true,
							dataType:'json', 
			                contentType:"application/json",
			                success:function(data){
			                	console.log(data)
			                	$(".ischanges_mima").remove();
			                	document.location.reload();
			                },
			                error:function(error){
			                	console.log("服务器错误")
			                }
						});
						});
						$(".returns").click(function(){
							$(".ischanges_mima").remove();
					
						})
						$(".ischanges_mima .mima").click(function(event){
        						event.stopPropagation(); // 阻止点击事件的冒泡
					    });
					    $(".ischanges_mima").on("click" , function(eventBody){
					        $(".ischanges_mima").remove();
					    });
                	})
                })
                }
                adds()
                function adds(){//修改密码函数
                	
                
                $(".adds").each(function(i){//管理员修改用户密码
                	$(this).click(function(){
                			var index=i;
                			var change_phone=$(".use_id_"+index).text();//获取修改的用户的id
                			$("body").append('<div class="ischanges_mima">'+
                			'<div class="xiugai"><input type="text"  class="pwd_change" placeholder="请输入新的密码"/>'+
                			'<input type="button" value="提交" class="submit_mima"/></div></div>');
						$(".submit_mima").click(function(){
							var pwd_change=$(".pwd_change").val();
							console.log(pwd_change)
							phone = sessionStorage.getItem("phone");
							var reg=/([A-Za-z0-9]){6,}/;
							if(pwd_change.match(reg)){
								console.log(change_phone+"----"+pwd_change+"----"+phone)
								$.ajax({
							type:"post",
							url:"https://jindi163.com:8443/JDLot/admin/user/reset",
							data:{
							"phono":change_phone,//用户手机号
							"pwd":pwd_change,    //用户密码
//							"phone":phone        //管理员手机号
							},
							xhrFields: {
   						 withCredentials: true
						},
					crossDomain: true,
							async:true,
							dataType:'json', 
			                contentType:"application/json",
			                success:function(data){
			                	$(".ischanges_mima").remove();
//			                	document.location.reload();
			                },
			                error:function(error){
			                	console.log("error")
			                }
						});
							}else{
								return
							}
							
						});
						$(".ischanges_mima .xiugai").click(function(event){
        						event.stopPropagation(); // 阻止点击事件的冒泡
					    });
					    $(".ischanges_mima").on("click" , function(eventBody){
					        $(".ischanges_mima").remove();
					    });
						})
                	})
                }
                $(".returns").click(function(){
							$(".ischanges_mima").remove();
						})
           
           
           
           		find_xiaofei()
             function find_xiaofei(){//查看用户消费记录
                	
                
                $(".cost_ite").each(function(i){
                	$(this).click(function(){
                			var index=i;
                			var change_phone=$(".uid_"+index).text();//获取修改的用户的id
          								$.ajax({
											type:"post",
											url:"https://jindi163.com:8443/JDLot/admin/user/orderlist",
											data:{
											"uid":change_phone,//用户id
											"PageNum":1  ,      //
											"PageSize":10
											},
											xhrFields: {
   						 withCredentials: true
						},
					crossDomain: true,
											async:true,
											dataType:'json', 
							                contentType:"application/json",
							                success:function(data){
							                	console.log(data)
							                var data = data.datas;
											var total=(data.length)/10;
											$('.costList').empty();
											$("body").append('<div id="cost_msg"><a class="close_it closeITEM">关闭</a><ol class="costList"></ol><div class="PageCode_one"></div></div>');
											var strs='<li class="masg_lis" style="color:red"><span>开始时间</span><span>到期时间</span><span>商品消费</span><span>消费类型</span><span>消费明细</span></li>';  
                	for(var i=0;i<data.length;i++){  
		                    var item = data[i];
		                    var body=item.body;
		                    var gmt_createment=item.gmt_createment;
							if(body=="包天"){
								gmt_createment=gmt_createment+(1*24*60*60*1000);
							}else if(body=="包周"){
								gmt_createment=gmt_createment+(7*24*60*60*1000);
							}else if(body=="包月"){
								gmt_createment=gmt_createment+(30*24*60*60*1000);
							}
							else{
								gmt_createment="";
							}
				
					var oDate = new Date(gmt_createment),    
		            oYear = oDate.getFullYear(),    
		            oMonth = oDate.getMonth()+1,    
		            oDay = oDate.getDate(),    
		            oHour = oDate.getHours(),    
		            oMin = oDate.getMinutes(),    
		            oSen = oDate.getSeconds(),    
		            doTime = oYear +'-'+ getzf(oMonth) +'-'+ getzf(oDay) +'-'+ getzf(oHour) +':'+ getzf(oMin) +':'+getzf(oSen);//最后拼接时间    
	 				
	 				var oDates = new Date(item.gmt_createment),    
		            oYears = oDates.getFullYear(),    
		            oMonths = oDates.getMonth()+1,    
		            oDays = oDates.getDate(),    
		            oHours = oDates.getHours(),    
		            oMins = oDates.getMinutes(),    
		            oSens = oDates.getSeconds(),    
		            doTimes = oYears +'-'+ getzf(oMonths) +'-'+ getzf(oDays) +'-'+ getzf(oHours) +':'+ getzf(oMins) +':'+getzf(oSens);//最后拼接时间    
	 
			        //补0操作    
			        function getzf(num){    
			            if(parseInt(num) < 10){    
			                num = '0'+num;    
			            }    
			            return num;    
			        }  
							
							
                    		strs +=	'<li class="masg_lis"><span class="use_id_'+i+'">'+doTimes+	
                    				'</span><span>'+doTime+
		                    		'</span><span>'+item.subject+
		                    		'</span><span>'+item.body+
		                    		'</span><span>'+item.total_amount+
		                    		'</span></li>';  
                }  
        //追加渲染到页面  
                $('.costList').append(strs);	
		//分页插件，  
                $(".PageCode_one").createPage({  
                    //pageCount：总页数  
                    pageCount:total,  
                    //current：当前页  默认第一页
                    current:1,  
                    backFn:function(pageIndex){  
                    //单击回调方法，pageIndex是当前页码  
                        $(".costList").empty();  
                        var start =pageIndex;//开始的页码数
 						var change_phone=$(".uid_"+index).text();//获取修改的用户的id
                       			$.ajax({  
			                            url:"https://jindi163.com:8443/JDLot/admin/user/orderlist",  
			                            type:'post',  
			                            dataType:'json', 
			                            contentType:"application/json",
							            async:true,
							            cache:false,
			                           data: {
										"uid":change_phone,//

										"PageNum":start
										},
										xhrFields: {
   										 withCredentials: true
						},
										crossDomain: true,
			                            success:function(data){  
				                               var data  = data.datas;
				                               $("body").append('<div id="cost_msg"><a class="close_it closeITEM">关闭</a><ol class="costList"></ol><div class="PageCode_one"></div></div>');
											
				                               var strs='<li class="masg_lis" style="color:red"><span>开始时间</span><span>到期时间</span><span>商品消费</span><span>消费明细</span></li>';  
							                	for(var i=0;i<data.length;i++){  
									                    var item = data[i];
		                    var body=item.body;
		                    var gmt_createment=item.gmt_createment;
							if(body=="包天"){
								gmt_createment=gmt_createment+(1*24*60*60*1000);
							}else if(body=="包周"){
								gmt_createment=gmt_createment+(7*24*60*60*1000);
							}else if(body=="包月"){
								gmt_createment=gmt_createment+(30*24*60*60*1000);
							}
							else{
								gmt_createment="";
							}
				
					var oDate = new Date(gmt_createment),    
		            oYear = oDate.getFullYear(),    
		            oMonth = oDate.getMonth()+1,    
		            oDay = oDate.getDate(),    
		            oHour = oDate.getHours(),    
		            oMin = oDate.getMinutes(),    
		            oSen = oDate.getSeconds(),    
		            doTime = oYear +'-'+ getzf(oMonth) +'-'+ getzf(oDay) +'-'+ getzf(oHour) +':'+ getzf(oMin) +':'+getzf(oSen);//最后拼接时间    
	 				
	 				var oDates = new Date(item.gmt_createment),    
		            oYears = oDates.getFullYear(),    
		            oMonths = oDates.getMonth()+1,    
		            oDays = oDates.getDate(),    
		            oHours = oDates.getHours(),    
		            oMins = oDates.getMinutes(),    
		            oSens = oDates.getSeconds(),    
		            doTimes = oYears +'-'+ getzf(oMonths) +'-'+ getzf(oDays) +'-'+ getzf(oHours) +':'+ getzf(oMins) +':'+getzf(oSens);//最后拼接时间    
	 
			        //补0操作    
			        function getzf(num){    
			            if(parseInt(num) < 10){    
			                num = '0'+num;    
			            }    
			            return num;    
			        }  
							
							
                    		strs +=	'<li class="masg_lis"><span class="use_id_'+i+'">'+doTimes+	
                    				'</span><span>'+doTime+
		                    		'</span><span>'+item.subject+
		                    		'</span><span>'+item.body+
		                    		'</span><span>'+item.total_amount+
		                    		'</span></li>'; 
							                }  
                				//追加渲染到页面  
               							 $('.costList').append(strs);
               							 $("#cost_msg .closeITEM").click(function(){
               							 	$("#cost_msg").remove();
               							 })
               									}  
			                        }) 
			                  
                    			}  
                			}); 
                			 $("#cost_msg .closeITEM").click(function(){
               							 	$("#cost_msg").remove();
               							 })
							                }
										});
							
						})
                	})
                }
           
       
            		},
      				error:function(error){
            	alert("请求数据失败！")
            }, 
       			}) 
       		}
	
	
	
	$(".findings").click(function(){
			var use_search=$("#use_search").val();
			if (use_search=="") {
				alert("手机号不能为空"); 
			} else{
				use_search=$("#use_search").val();
//				phone = sessionStorage.getItem("phone");
//				console.log(phone)
			$.ajax({  
            url:urlApi_find,  
            type:'post',  
            dataType:'json',
            contentType:"application/json",
            async:true,
            cache:false,
            data: {
//          	"phone":phone,
				"phono":use_search
            },//参数配置：
            xhrFields: {
   						 withCredentials: true
						},
					crossDomain: true,
            success:function(res){
            	var data=res.datas;
            	console.log(res)
            	$(".show_find").empty();
            	var strss='<li class="masg_lis" style="color:red"><span>用户账号</span><span>用户密码</span><span>注册时间</span><span>管理员操作</span></li>';  
                    		strss +=	'<li class="masg_lis"><span class="uid_hao">'+data.uphono+
		                    		'</span><span>'+data.upwd+
		                    		'<p	style="color:#fff;position:relative;top:-9999px;" class="uid">'+data.uid+'</p></span><span>'+data.uregtime+
		                    		'</span><span><input type="button" class="cost costIT"  value="消费记录"><input type="button" class="adds"  value="修改"><input class="deleted" type="button" value="删除">'+
		                    		'</span></li>';  

                $(".show_find").append(strss)
              		delect();	
                	function delect(){//删除用户
                $(".deleted").each(function(i){//管理员删除用户
                	$(this).click(function(){
                		var index=i;
                		phone = sessionStorage.getItem("phone");
                	    usephone=$(".uid").text();//获取删除的用户的id
                	   
						$("body").append('<div class="ischanges_mima"><div class="mima"><input type="button" value="确认删除" class="isdelet"/><input type="button" value="返回" class="returns"/></div></div>');
						$(".isdelet").click(function(){
						 console.log(phone+"---"+usephone)	
							$.ajax({
							type:"post",
							url:"https://jindi163.com:8443/JDLot/admin/user/del",
							data:{
							"uid":usephone,
//							"phone":phone,
							},
							xhrFields: {
   						 withCredentials: true
						},
					crossDomain: true,
							async:true,
							dataType:'json', 
			                contentType:"application/json",
			                success:function(data){
			                	alert(data)
			                	$(".ischanges_mima").remove();
//			                	document.location.reload();
			                },
			                error:function(error){
			                	console.log(1111111)
			                }
						});
						});
						$(".returns").click(function(){
							$(".ischanges_mima").remove();
					
						})
						$(".ischanges_mima .mima").click(function(event){
        						event.stopPropagation(); // 阻止点击事件的冒泡
					    });
					    $(".ischanges_mima").on("click" , function(eventBody){
			
					        $(".ischanges_mima").remove();
					    });
                	})
                })
                }
                adds()
                function adds(){//修改密码函数
                	
                
                $(".adds").each(function(i){//管理员修改用户密码
                	$(this).click(function(){
                			var index=i;
                			var change_phone=$(".uid_hao").text();//获取修改的用户的id
                			$("body").append('<div class="ischanges_mima">'+
                			'<div class="xiugai"><input type="text"  class="pwd_change" placeholder="请输入新的密码"/>'+
                			'<input type="button" value="提交" class="submit_mima"/></div></div>');
						$(".submit_mima").click(function(){
							var pwd_change=$(".pwd_change").val();
							console.log(pwd_change)
							phone = sessionStorage.getItem("phone");
							var reg=/([A-Za-z0-9]){6,}/;
							if(pwd_change.match(reg)){
//								console.log(change_phone+"----"+pwd_change+"----"+phone)
								$.ajax({
							type:"post",
							url:"https://jindi163.com:8443/JDLot/admin/user/reset",
							data:{
							"phono":change_phone,//用户手机号
							"pwd":pwd_change,    //用户密码
//							"phone":phone        //管理员手机号
							},
							xhrFields: {
   						 withCredentials: true
						},
					crossDomain: true,
							async:true,
							dataType:'json', 
			                contentType:"application/json",
			                success:function(data){
			                	$(".ischanges_mima").remove();
			                	document.location.reload();
			                },
			                error:function(error){
			                	console.log("error")
			                }
						});
							}else{
								return
							}
							
						});
						$(".ischanges_mima .xiugai").click(function(event){
        						event.stopPropagation(); // 阻止点击事件的冒泡
					    });
					    $(".ischanges_mima").on("click" , function(eventBody){
					        $(".ischanges_mima").remove();
					    });
						})
                	})
                }
                $(".returns").click(function(){
							$(".ischanges_mima").remove();
						})
                		finds()
                function finds(){//查看用户消费记录
                $(".costIT").each(function(i){
                	$(this).click(function(){
                		var index=i;
                	    usephone=$(".uid").text();//获取删除的用户的id
                	    $("#cost_msgs").remove();
							$.ajax({
											type:"post",
											url:"https://jindi163.com:8443/JDLot/admin/user/orderlist",
											data:{
											"uid":usephone,//用户手机号
											"PageNum":1        //管理员手机号
											},
											xhrFields: {
   						 withCredentials: true
						},
					crossDomain: true,
											async:true,
											dataType:'json', 
							                contentType:"application/json",
							                success:function(data){
							                	console.log(data)
													var data = data.datas;
													
											var total=(data.length)/10;
											$("body").append('<div id="cost_msgs"><a class="close_it">关闭</a><ol class="costList"></ol><div class="PageCode_one"></div></div>');	
									
                						var strss='<li class="masg_lis" style="color:red"><span>开始时间</span><span>到期时间</span><span>商品消费</span><span>消费类型</span><span>消费明细</span></li>';  
                	for(var i=0;i<data.length;i++){  
									                    var item = data[i];
									                    
									                     var item = data[i];
		                    var body=item.body;
		                    var gmt_createment=item.gmt_createment;
							if(body=="包天"){
								gmt_createment=gmt_createment+(1*24*60*60*1000);
							}else if(body=="包周"){
								gmt_createment=gmt_createment+(7*24*60*60*1000);
							}else if(body=="包月"){
								gmt_createment=gmt_createment+(30*24*60*60*1000);
							}
							else{
								gmt_createment="";
							}
				
					var oDate = new Date(gmt_createment),    
		            oYear = oDate.getFullYear(),    
		            oMonth = oDate.getMonth()+1,    
		            oDay = oDate.getDate(),    
		            oHour = oDate.getHours(),    
		            oMin = oDate.getMinutes(),    
		            oSen = oDate.getSeconds(),    
		            doTime = oYear +'-'+ getzf(oMonth) +'-'+ getzf(oDay) +'-'+ getzf(oHour) +':'+ getzf(oMin) +':'+getzf(oSen);//最后拼接时间    
	 				
	 				var oDates = new Date(item.gmt_createment),    
		            oYears = oDates.getFullYear(),    
		            oMonths = oDates.getMonth()+1,    
		            oDays = oDates.getDate(),    
		            oHours = oDates.getHours(),    
		            oMins = oDates.getMinutes(),    
		            oSens = oDates.getSeconds(),    
		            doTimes = oYears +'-'+ getzf(oMonths) +'-'+ getzf(oDays) +'-'+ getzf(oHours) +':'+ getzf(oMins) +':'+getzf(oSens);//最后拼接时间    
	 
			        //补0操作    
			        function getzf(num){    
			            if(parseInt(num) < 10){    
			                num = '0'+num;    
			            }    
			            return num;    
			        }  
		                   			strss +='<li class="masg_lis"><span class="use_id_'+i+'">'+doTimes+
							        '</span><span>'+doTime+
		                    		'</span><span>'+item.subject+
		                    		'</span><span>'+item.body+
		                    		'</span><span>'+item.total_amount+
		                    		
		                    		'</span></li>';  
                }  

              		$('.costList').append(strss);	
			 //分页插件，  
                $(".PageCode_one").createPage({  
                    //pageCount：总页数  
                    pageCount:total,  
                    //current：当前页  默认第一页
                    current:1,  
                    backFn:function(pageIndex){  
                    //单击回调方法，pageIndex是当前页码  
                        $("#cost_msgS").remove();	
                        var start =pageIndex;//开始的页码数
 						var change_phone=$(".uid_"+index).text();//获取修改的用户的id
                       			$.ajax({  
			                            url:"https://jindi163.com:8443/JDLot/admin/user/orderlist",  
			                            type:'post',  
			                            dataType:'json', 
			                            contentType:"application/json",
							            async:true,
							            cache:false,
			                           data: {
										"uid":change_phone,//管理员的手机号码

										"PageNum":start
										},
										xhrFields: {
   						 withCredentials: true
						},
									crossDomain: true,
			                            success:function(data){  
				                               var data  = data.datas;
				                               $("body").append('<div id="cost_msgs"><a class="close_it">关闭</a><ol class="costList"></ol><div class="PageCode_one"></div></div>');	
											
				                               var strs='<li class="masg_lis" style="color:red"><span>开始时间</span><span>到期时间</span><span>商品消费</span><span>消费类型</span><span>消费明细</span></li>'; 
							                	for(var i=0;i<data.length;i++){  
									                    var item = data[i];
									                    
									                     var item = data[i];
		                    var body=item.body;
		                    var gmt_createment=item.gmt_createment;
							if(body=="包天"){
								gmt_createment=gmt_createment+(1*24*60*60*1000);
							}else if(body=="包周"){
								gmt_createment=gmt_createment+(7*24*60*60*1000);
							}else if(body=="包月"){
								gmt_createment=gmt_createment+(30*24*60*60*1000);
							}
							else{
								gmt_createment="";
							}
				
					var oDate = new Date(gmt_createment),    
		            oYear = oDate.getFullYear(),    
		            oMonth = oDate.getMonth()+1,    
		            oDay = oDate.getDate(),    
		            oHour = oDate.getHours(),    
		            oMin = oDate.getMinutes(),    
		            oSen = oDate.getSeconds(),    
		            doTime = oYear +'-'+ getzf(oMonth) +'-'+ getzf(oDay) +'-'+ getzf(oHour) +':'+ getzf(oMin) +':'+getzf(oSen);//最后拼接时间    
	 				
	 				var oDates = new Date(item.gmt_createment),    
		            oYears = oDates.getFullYear(),    
		            oMonths = oDates.getMonth()+1,    
		            oDays = oDates.getDate(),    
		            oHours = oDates.getHours(),    
		            oMins = oDates.getMinutes(),    
		            oSens = oDates.getSeconds(),    
		            doTimes = oYears +'-'+ getzf(oMonths) +'-'+ getzf(oDays) +'-'+ getzf(oHours) +':'+ getzf(oMins) +':'+getzf(oSens);//最后拼接时间    
	 
			        //补0操作    
			        function getzf(num){    
			            if(parseInt(num) < 10){    
			                num = '0'+num;    
			            }    
			            return num;    
			        }  
							                    			strs +=	'<li class="masg_lis"><span class="use_id_'+i+'">'+doTimes+
							                    			'</span><span>'+doTime+
								                    		'</span><span>'+item.subject+
								                    		'</span><span>'+item.body+
								                    		'</span><span>'+item.total_amount+
								                    		'</span></li>'; 
							                }  
                				//追加渲染到页面  
               							 $('.costList').append(strs);
               					
               							}  
			                        }) 
			                  
                    			}  
                			}); 
                			
                			$("#cost_msgs .close_it").click(function(){
								$("#cost_msgs").remove();
					        })
							    }
						});
					
						
                	})
                })
                }
                
                
                
                
                
                
            }
            })
			}
			 
		})
})
